﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace LS.FrmUI
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new FrmLogin());


            bool runone;
            System.Threading.Mutex run = new System.Threading.Mutex(true, "single_test", out runone);
            if (runone)
            {
                run.ReleaseMutex();
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                FrmLogin frm = new FrmLogin();
                int hdc = frm.Handle.ToInt32(); // write to ...
                Application.Run(frm);
                IntPtr a = new IntPtr(hdc);
            }
            else
            {
                MessageBox.Show("程序已经运行。");
                //IntPtr hdc = new IntPtr(1312810); // read from...
                //bool flash = FlashWindow(hdc, true);
            }
        }
    }
}
